#ifndef _EXTRA_HEADERS_
#define _EXTRA_HEADERS_

#define _DELETE(X){					\
	if(X)							\
	{								\
		free(X);					\
		X = NULL;					\
	}								\
}									\

#define ITT_CHUNK_CHECK(I,C) {		\
	if(I >= 127)					\
	{								\
		C++;						\
		I = -1;						\
	}								\
}									\

#define Set_Color(X) {							\
	HANDLE hConsole;							\
	int Hold = 'a'-'A';							\
	hConsole = GetStdHandle(STD_OUTPUT_HANDLE);	\
	if(X < 'a') Hold = X + Hold; else Hold = X;	\
	switch(Hold)								\
	{											\
	case 'g': Hold = 2;	break;					\
	case 'r': Hold = 4;	break;					\
	case 'y': Hold = 6;	break;					\
	case 'c': Hold = 3;	break;					\
	case 'b': Hold = 9;	break;					\
	case 'p': Hold = 5;	break;					\
	case 'n': Hold = 7;	break;					\
	}											\
	SetConsoleTextAttribute(hConsole, Hold);	\
}												\

//for(i = 0;i < sizeof(C) / sizeof(char);i++) {
//	Set_Color(C[i]);
//	printf("test\n");
//}


#define WHOLE_SCREEN 80

#define MENU_LENGTH 5

#define ENTRY_LENGTH 50

#define IGNORE_POS -1

#define TIME_DATE_SIZE sizeof(char) * 50

#define BOOK_MENU "1 : Read Diary\n2 : Add Entry\n3 : Save All\n4 : QUIT\n"

#define BOOK_PRINT_MENU "1 : Next Page\n2 : Previous Page\n3 : Delete Page\n4 : Back"

#include <Windows.h>
#include <stdio.h>
#include <conio.h>
#include <time.h>
#include "Buffer.h"
#include "Book.h"

void Clear_Screen(int H,int D);

void Set_Cursor_XY(int x,int y);

void Set_Cursor_XYA(COORD C);

COORD Get_Cursor_XY();

#endif